<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>迭代器</title>
</head>
<body>
    
</body>
<script>
    let arr = [1,2,3,4];
    let each = function (arr, callback) {
        for (let index = 0; index < arr.length; index++) {
            callback.call(null, i, arr[i]);
        }
    }
</script>
</html>